package com.huitu.whht.base.core.api.wq.awqmd;

import com.huitu.api.rest.AbstractApiResource;
import com.huitu.commons.PageUtils;
import com.huitu.whht.api.core.common.response.ApiResultBuilder;
import com.huitu.whht.api.core.common.annotations.SzyCoreApiResource;
import com.huitu.whht.api.core.common.annotations.SzyCoreApiService;
import com.huitu.whht.api.core.common.response.StatusRespBuilder;
import com.huitu.whht.api.core.common.util.LocalDateTimeUtil;
import java.time.LocalDateTime;
import com.huitu.whht.base.core.api.wq.awqmd.entities.WqAwqmdDLatest;
import com.huitu.whht.base.core.api.wq.awqmd.entities.WqAwqmdDLatestKey;
import com.huitu.whht.base.core.api.wq.awqmd.entities.WqAwqmdDLatestQo;
import com.huitu.whht.base.core.api.wq.awqmd.service.IWqAwqmdDLatestService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

/**
 * 说明: API,表名称: T_WHHT_WQ_AWQMD_D_LATEST <br/>
 * 日期: 2019-04-15
 * @author LiuCW
 */
@Component
@SzyCoreApiResource
@Path("wq/awqmd/d/latest")
public class WqAwqmdDLatestResource extends AbstractApiResource {

    private static final Logger LOGGER = LoggerFactory.getLogger(WqAwqmdDLatestResource.class);

    private static final String UUID = "8154721e-4ffb-43e0-bb6a-8e1e86f34e09";

    @Override
    public String getUUID() {
        return UUID;
    }

    @Autowired
    @SzyCoreApiService
    IWqAwqmdDLatestService wqAwqmdDLatestService;

    /**
     * @api {get} wq/awqmd/d/latest/{stcd:\\w{8}}/{spt}/{isHistory:\\w{1}} [R][G]根据主键查询
     * @apiDescription [G]根据主键查询T_WHHT_WQ_AWQMD_D_LATEST()数据
     * @apiName (generate)select by primary key
     * @apiGroup WQ_AWQMD_D_LATEST-
     * @apiVersion 1.0.0
     * @apiSampleRequest wq/awqmd/d/latest/62285151/2017-12-31 08:00:31/1
     * @apiParam   {String}         stcd               【必须】暂无注释
     * @apiParam   {Date}           spt                【必须】暂无注释
     * @apiParam   {String}         isHistory          【必须】暂无注释
     * @apiSuccess {String}         stcd               暂无注释
     * @apiSuccess {Date}           spt                暂无注释(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Double}         wt                 暂无注释
     * @apiSuccess {Double}         ph                 暂无注释
     * @apiSuccess {Integer}        cond               暂无注释
     * @apiSuccess {Integer}        turb               暂无注释
     * @apiSuccess {Double}         dox                暂无注释
     * @apiSuccess {Double}         codmn              暂无注释
     * @apiSuccess {Double}         codcr              暂无注释
     * @apiSuccess {Double}         tn                 暂无注释
     * @apiSuccess {Double}         nh3n               暂无注释
     * @apiSuccess {Double}         no2                暂无注释
     * @apiSuccess {Double}         no3                暂无注释
     * @apiSuccess {Double}         tp                 暂无注释
     * @apiSuccess {Double}         toc                暂无注释
     * @apiSuccess {Double}         vlph               暂无注释
     * @apiSuccess {Double}         chla               暂无注释
     * @apiSuccess {Double}         f                  暂无注释
     * @apiSuccess {Double}         ars                暂无注释
     * @apiSuccess {Double}         hg                 暂无注释
     * @apiSuccess {Double}         cr6                暂无注释
     * @apiSuccess {Double}         cu                 暂无注释
     * @apiSuccess {Double}         pb                 暂无注释
     * @apiSuccess {Double}         cd                 暂无注释
     * @apiSuccess {Double}         zn                 暂无注释
     * @apiSuccess {Double}         sb                 暂无注释
     * @apiSuccess {String}         speRegData         暂无注释
     * @apiSuccess {Date}           ts                 暂无注释(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Date}           testComTm          暂无注释(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {String}         isHistory          暂无注释
     * @apiSuccess {Date}           tm                 暂无注释(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccessExample 请求成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "stcd": "62285151",
     * "spt": "2017-12-31 08:00:31.0",
     * "wt": 9.2,
     * "ph": 7.78,
     * "cond": 233,
     * "turb": 4,
     * "dox": 9.8,
     * "codmn": 2.8,
     * "codcr": null,
     * "tn": 0.66,
     * "nh3n": 0,
     * "no2": null,
     * "no3": null,
     * "tp": 0.001,
     * "toc": null,
     * "vlph": null,
     * "chla": null,
     * "f": null,
     * "ars": null,
     * "hg": null,
     * "cr6": null,
     * "cu": null,
     * "pb": null,
     * "cd": null,
     * "zn": null,
     * "sb": null,
     * "speRegData": "0",
     * "ts": "2017-12-31 10:00:00.0",
     * "testComTm": null,
     * "isHistory": "1",
     * "tm": "2018-12-27 14:02:19.0"
     *  }
     * }
     * @apiUse exceptions
     */
    @GET
    @Path("{stcd:\\w{8}}/{spt}/{isHistory:\\w{1}}")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response selectByPrimaryKey(@PathParam("stcd") String stcd,@PathParam("spt") String spt,@PathParam("isHistory") String isHistory) {
        WqAwqmdDLatestKey pk = new WqAwqmdDLatestKey();
        pk.setStcd(stcd);
        LocalDateTime.parse(spt,LocalDateTimeUtil.DATE_TIME_FORMATTER_YMD_HMS);
        pk.setIsHistory(isHistory);
        LOGGER.info("根据主键查询 ,参数 pk:{}", pk);
        return Response.ok(ApiResultBuilder.create(this, wqAwqmdDLatestService.selectByPrimaryKey(pk))).build();
    }

    /**
     * @api {post} wq/awqmd/d/latest/list [R][G]根据条件查询
     * @apiDescription [G]根据条件查询T_WHHT_WQ_AWQMD_D_LATEST()数据
     * @apiName (generate)select by filter
     * @apiGroup WQ_AWQMD_D_LATEST-
     * @apiVersion 1.0.0
     * @apiSampleRequest wq/awqmd/d/latest/list
     * @apiParam   {String}         stcd               暂无注释
     * @apiParam   {Date}           sptBgTm            (开始时间)暂无注释
     * @apiParam   {Date}           sptEdTm            (结束时间)暂无注释
     * @apiParam   {List(Double)}   wtList             (数组)暂无注释
     * @apiParam   {List(Double)}   phList             (数组)暂无注释
     * @apiParam   {Integer}        condMin            (最小)暂无注释
     * @apiParam   {Integer}        condMax            (最大)暂无注释
     * @apiParam   {List(Integer)}  turbList           (数组)暂无注释
     * @apiParam   {List(Double)}   doxList            (数组)暂无注释
     * @apiParam   {Double}         codmnMin           (最小)暂无注释
     * @apiParam   {Double}         codmnMax           (最大)暂无注释
     * @apiParam   {Double}         codcrMin           (最小)暂无注释
     * @apiParam   {Double}         codcrMax           (最大)暂无注释
     * @apiParam   {Double}         tnMin              (最小)暂无注释
     * @apiParam   {Double}         tnMax              (最大)暂无注释
     * @apiParam   {Double}         nh3nMin            (最小)暂无注释
     * @apiParam   {Double}         nh3nMax            (最大)暂无注释
     * @apiParam   {Double}         no2Min             (最小)暂无注释
     * @apiParam   {Double}         no2Max             (最大)暂无注释
     * @apiParam   {Double}         no3Min             (最小)暂无注释
     * @apiParam   {Double}         no3Max             (最大)暂无注释
     * @apiParam   {Double}         tpMin              (最小)暂无注释
     * @apiParam   {Double}         tpMax              (最大)暂无注释
     * @apiParam   {List(Double)}   tocList            (数组)暂无注释
     * @apiParam   {Double}         vlphMin            (最小)暂无注释
     * @apiParam   {Double}         vlphMax            (最大)暂无注释
     * @apiParam   {Double}         chlaMin            (最小)暂无注释
     * @apiParam   {Double}         chlaMax            (最大)暂无注释
     * @apiParam   {Double}         fMin               (最小)暂无注释
     * @apiParam   {Double}         fMax               (最大)暂无注释
     * @apiParam   {Double}         arsMin             (最小)暂无注释
     * @apiParam   {Double}         arsMax             (最大)暂无注释
     * @apiParam   {Double}         hgMin              (最小)暂无注释
     * @apiParam   {Double}         hgMax              (最大)暂无注释
     * @apiParam   {Double}         cr6Min             (最小)暂无注释
     * @apiParam   {Double}         cr6Max             (最大)暂无注释
     * @apiParam   {Double}         cuMin              (最小)暂无注释
     * @apiParam   {Double}         cuMax              (最大)暂无注释
     * @apiParam   {Double}         pbMin              (最小)暂无注释
     * @apiParam   {Double}         pbMax              (最大)暂无注释
     * @apiParam   {Double}         cdMin              (最小)暂无注释
     * @apiParam   {Double}         cdMax              (最大)暂无注释
     * @apiParam   {Double}         znMin              (最小)暂无注释
     * @apiParam   {Double}         znMax              (最大)暂无注释
     * @apiParam   {Double}         sbMin              (最小)暂无注释
     * @apiParam   {Double}         sbMax              (最大)暂无注释
     * @apiParam   {List(String)}   speRegDataList     (数组)暂无注释
     * @apiParam   {Date}           tsBgTm             (开始时间)暂无注释
     * @apiParam   {Date}           tsEdTm             (结束时间)暂无注释
     * @apiParam   {Date}           testComTmBgTm      (开始时间)暂无注释
     * @apiParam   {Date}           testComTmEdTm      (结束时间)暂无注释
     * @apiParam   {List(String)}   isHistoryList      (数组)暂无注释
     * @apiParam   {Date}           tmBgTm             (开始时间)暂无注释
     * @apiParam   {Date}           tmEdTm             (结束时间)暂无注释
     * @apiSuccess {String}         stcd               暂无注释
     * @apiSuccess {Date}           spt                暂无注释
     * @apiSuccess {Double}         wt                 暂无注释
     * @apiSuccess {Double}         ph                 暂无注释
     * @apiSuccess {Integer}        cond               暂无注释
     * @apiSuccess {Integer}        turb               暂无注释
     * @apiSuccess {Double}         dox                暂无注释
     * @apiSuccess {Double}         codmn              暂无注释
     * @apiSuccess {Double}         codcr              暂无注释
     * @apiSuccess {Double}         tn                 暂无注释
     * @apiSuccess {Double}         nh3n               暂无注释
     * @apiSuccess {Double}         no2                暂无注释
     * @apiSuccess {Double}         no3                暂无注释
     * @apiSuccess {Double}         tp                 暂无注释
     * @apiSuccess {Double}         toc                暂无注释
     * @apiSuccess {Double}         vlph               暂无注释
     * @apiSuccess {Double}         chla               暂无注释
     * @apiSuccess {Double}         f                  暂无注释
     * @apiSuccess {Double}         ars                暂无注释
     * @apiSuccess {Double}         hg                 暂无注释
     * @apiSuccess {Double}         cr6                暂无注释
     * @apiSuccess {Double}         cu                 暂无注释
     * @apiSuccess {Double}         pb                 暂无注释
     * @apiSuccess {Double}         cd                 暂无注释
     * @apiSuccess {Double}         zn                 暂无注释
     * @apiSuccess {Double}         sb                 暂无注释
     * @apiSuccess {String}         speRegData         暂无注释
     * @apiSuccess {Date}           ts                 暂无注释
     * @apiSuccess {Date}           testComTm          暂无注释
     * @apiSuccess {String}         isHistory          暂无注释
     * @apiSuccess {Date}           tm                 暂无注释
     * @apiSuccessExample 请求成功:
     * HTTP/1.1 200 OK
     * {
     * "result": [{
     * "stcd": "62285151",
     * "spt": "2017-12-31 08:00:31.0",
     * "wt": 9.2,
     * "ph": 7.78,
     * "cond": 233,
     * "turb": 4,
     * "dox": 9.8,
     * "codmn": 2.8,
     * "codcr": null,
     * "tn": 0.66,
     * "nh3n": 0,
     * "no2": null,
     * "no3": null,
     * "tp": 0.001,
     * "toc": null,
     * "vlph": null,
     * "chla": null,
     * "f": null,
     * "ars": null,
     * "hg": null,
     * "cr6": null,
     * "cu": null,
     * "pb": null,
     * "cd": null,
     * "zn": null,
     * "sb": null,
     * "speRegData": "0",
     * "ts": "2017-12-31 10:00:00.0",
     * "testComTm": null,
     * "isHistory": "1",
     * "tm": "2018-12-27 14:02:19.0"
     *  }]
     * }
     *
     * @apiSuccessExample 分页请求:
     * request header: Rang={max=50;size=50;field=TS DESC}
     * HTTP/1.1 200 OK
     * {
     * "result": [{
     * "stcd": "62285151",
     * "spt": "2017-12-31 08:00:31.0",
     * "wt": 9.2,
     * "ph": 7.78,
     * "cond": 233,
     * "turb": 4,
     * "dox": 9.8,
     * "codmn": 2.8,
     * "codcr": null,
     * "tn": 0.66,
     * "nh3n": 0,
     * "no2": null,
     * "no3": null,
     * "tp": 0.001,
     * "toc": null,
     * "vlph": null,
     * "chla": null,
     * "f": null,
     * "ars": null,
     * "hg": null,
     * "cr6": null,
     * "cu": null,
     * "pb": null,
     * "cd": null,
     * "zn": null,
     * "sb": null,
     * "speRegData": "0",
     * "ts": "2017-12-31 10:00:00.0",
     * "testComTm": null,
     * "isHistory": "1",
     * "tm": "2018-12-27 14:02:19.0"
     *  }],
     * "paging": {
     * "count": 3,
     * "total": 120,
     * "finale": false,
     * "index": 1
     * }
     * }
     * @apiUse header_rang
     * @apiUse exceptions
     */
    @POST
    @Path("list")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response selectList(WqAwqmdDLatestQo filter) {
        PageUtils.startPageFromRang();
        LOGGER.info("根据条件查询 ,参数 WqAwqmdDLatestQo:{}", filter);
        return Response.ok(ApiResultBuilder.create(this, wqAwqmdDLatestService.selectList(filter))).build();
    }

    /**
     * @api {put} wq/awqmd/d/latest [C][G]新增数据
     * @apiPrivate
     * @apiDescription [G]新增T_WHHT_WQ_AWQMD_D_LATEST()数据
     * @apiName (generate)add data
     * @apiGroup WQ_AWQMD_D_LATEST-
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               【必须】暂无注释
     * @apiParam   {Date}           spt                【必须】暂无注释(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Double}         wt                 暂无注释
     * @apiParam   {Double}         ph                 暂无注释
     * @apiParam   {Integer}        cond               暂无注释
     * @apiParam   {Integer}        turb               暂无注释
     * @apiParam   {Double}         dox                暂无注释
     * @apiParam   {Double}         codmn              暂无注释
     * @apiParam   {Double}         codcr              暂无注释
     * @apiParam   {Double}         tn                 暂无注释
     * @apiParam   {Double}         nh3n               暂无注释
     * @apiParam   {Double}         no2                暂无注释
     * @apiParam   {Double}         no3                暂无注释
     * @apiParam   {Double}         tp                 暂无注释
     * @apiParam   {Double}         toc                暂无注释
     * @apiParam   {Double}         vlph               暂无注释
     * @apiParam   {Double}         chla               暂无注释
     * @apiParam   {Double}         f                  暂无注释
     * @apiParam   {Double}         ars                暂无注释
     * @apiParam   {Double}         hg                 暂无注释
     * @apiParam   {Double}         cr6                暂无注释
     * @apiParam   {Double}         cu                 暂无注释
     * @apiParam   {Double}         pb                 暂无注释
     * @apiParam   {Double}         cd                 暂无注释
     * @apiParam   {Double}         zn                 暂无注释
     * @apiParam   {Double}         sb                 暂无注释
     * @apiParam   {String}         speRegData         暂无注释
     * @apiParam   {Date}           ts                 暂无注释(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Date}           testComTm          暂无注释(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {String}         isHistory          【必须】暂无注释
     * @apiParam   {Date}           tm                 【必须】暂无注释(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Integer}        status             1:新增成功;0:新增失败.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据,通常包含新增数据的主键值
     * @apiSampleRequest wq/awqmd/d/latest
     * @apiSuccessExample 新增成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":{
     *   "stcd": "62285151",
     *   "spt": "2017-12-31 08:00:31.0",
     *   "isHistory": "1"
     *      }
     *   }
     * }
     @apiSuccessExample 新增失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":{
     *   "stcd": "62285151",
     *   "spt": "2017-12-31 08:00:31.0",
     *   "isHistory": "1"
     *      }
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "stcd": "62285151",
     * "spt": "2017-12-31 08:00:31.0",
     * "wt": 9.2,
     * "ph": 7.78,
     * "cond": 233,
     * "turb": 4,
     * "dox": 9.8,
     * "codmn": 2.8,
     * "codcr": null,
     * "tn": 0.66,
     * "nh3n": 0,
     * "no2": null,
     * "no3": null,
     * "tp": 0.001,
     * "toc": null,
     * "vlph": null,
     * "chla": null,
     * "f": null,
     * "ars": null,
     * "hg": null,
     * "cr6": null,
     * "cu": null,
     * "pb": null,
     * "cd": null,
     * "zn": null,
     * "sb": null,
     * "speRegData": "0",
     * "ts": "2017-12-31 10:00:00.0",
     * "testComTm": null,
     * "isHistory": "1",
     * "tm": "2018-12-27 14:02:19.0"
     * }
     * @apiUse exceptions
     */
    @PUT
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response insert(WqAwqmdDLatest record) {
        LOGGER.info("新增 ,参数 WqAwqmdDLatest:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.insert(wqAwqmdDLatestService.insertSelective(record),record))).build();
    }

    /**
     * @api {post} wq/awqmd/d/latest/insertBatch [C][G]批量新增数据
     * @apiPrivate
     * @apiDescription [G]批量新增T_WHHT_WQ_AWQMD_D_LATEST()数据
     * @apiName (generate)addBatch data
     * @apiGroup WQ_AWQMD_D_LATEST-
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               【必须】暂无注释
     * @apiParam   {Date}           spt                【必须】暂无注释(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Double}         wt                 暂无注释
     * @apiParam   {Double}         ph                 暂无注释
     * @apiParam   {Integer}        cond               暂无注释
     * @apiParam   {Integer}        turb               暂无注释
     * @apiParam   {Double}         dox                暂无注释
     * @apiParam   {Double}         codmn              暂无注释
     * @apiParam   {Double}         codcr              暂无注释
     * @apiParam   {Double}         tn                 暂无注释
     * @apiParam   {Double}         nh3n               暂无注释
     * @apiParam   {Double}         no2                暂无注释
     * @apiParam   {Double}         no3                暂无注释
     * @apiParam   {Double}         tp                 暂无注释
     * @apiParam   {Double}         toc                暂无注释
     * @apiParam   {Double}         vlph               暂无注释
     * @apiParam   {Double}         chla               暂无注释
     * @apiParam   {Double}         f                  暂无注释
     * @apiParam   {Double}         ars                暂无注释
     * @apiParam   {Double}         hg                 暂无注释
     * @apiParam   {Double}         cr6                暂无注释
     * @apiParam   {Double}         cu                 暂无注释
     * @apiParam   {Double}         pb                 暂无注释
     * @apiParam   {Double}         cd                 暂无注释
     * @apiParam   {Double}         zn                 暂无注释
     * @apiParam   {Double}         sb                 暂无注释
     * @apiParam   {String}         speRegData         暂无注释
     * @apiParam   {Date}           ts                 暂无注释(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Date}           testComTm          暂无注释(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {String}         isHistory          【必须】暂无注释
     * @apiParam   {Date}           tm                 【必须】暂无注释(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Integer}        status             1:新增成功;0:新增失败.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据,通常包含新增数据的主键值
     * @apiSampleRequest wq/awqmd/d/latest/insertBatch
     * @apiSuccessExample 新增成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":{
     *   "stcd": "62285151",
     *   "spt": "2017-12-31 08:00:31.0",
     *   "isHistory": "1"
     *      }
     *   }
     * }
     @apiSuccessExample 新增失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":{
     *   "stcd": "62285151",
     *   "spt": "2017-12-31 08:00:31.0",
     *   "isHistory": "1"
     *      }
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * [{
     * "stcd": "62285151",
     * "spt": "2017-12-31 08:00:31.0",
     * "wt": 9.2,
     * "ph": 7.78,
     * "cond": 233,
     * "turb": 4,
     * "dox": 9.8,
     * "codmn": 2.8,
     * "codcr": null,
     * "tn": 0.66,
     * "nh3n": 0,
     * "no2": null,
     * "no3": null,
     * "tp": 0.001,
     * "toc": null,
     * "vlph": null,
     * "chla": null,
     * "f": null,
     * "ars": null,
     * "hg": null,
     * "cr6": null,
     * "cu": null,
     * "pb": null,
     * "cd": null,
     * "zn": null,
     * "sb": null,
     * "speRegData": "0",
     * "ts": "2017-12-31 10:00:00.0",
     * "testComTm": null,
     * "isHistory": "1",
     * "tm": "2018-12-27 14:02:19.0"
     * }]
     * @apiUse exceptions
     */
    @POST
    @Path("insertBatch")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response insertBatch(List<WqAwqmdDLatest> recordList) {
        LOGGER.info("批量新增 ,参数 WqAwqmdDLatest:[]", recordList);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.insert(wqAwqmdDLatestService.insertBatch(recordList),recordList))).build();
    }

    /**
     * @api {put} wq/awqmd/d/latest/{stcd:\\w{8}}/{spt}/{isHistory:\\w{1}}/update [U][G]根据主键修改
     * @apiPrivate
     * @apiDescription [G]根据主键修改T_WHHT_WQ_AWQMD_D_LATEST()数据
     * @apiName (generate)update data
     * @apiGroup WQ_AWQMD_D_LATEST-
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               【必须】暂无注释
     * @apiParam   {Date}           spt                【必须】暂无注释
     * @apiParam   {Double}         wt                 暂无注释
     * @apiParam   {Double}         ph                 暂无注释
     * @apiParam   {Integer}        cond               暂无注释
     * @apiParam   {Integer}        turb               暂无注释
     * @apiParam   {Double}         dox                暂无注释
     * @apiParam   {Double}         codmn              暂无注释
     * @apiParam   {Double}         codcr              暂无注释
     * @apiParam   {Double}         tn                 暂无注释
     * @apiParam   {Double}         nh3n               暂无注释
     * @apiParam   {Double}         no2                暂无注释
     * @apiParam   {Double}         no3                暂无注释
     * @apiParam   {Double}         tp                 暂无注释
     * @apiParam   {Double}         toc                暂无注释
     * @apiParam   {Double}         vlph               暂无注释
     * @apiParam   {Double}         chla               暂无注释
     * @apiParam   {Double}         f                  暂无注释
     * @apiParam   {Double}         ars                暂无注释
     * @apiParam   {Double}         hg                 暂无注释
     * @apiParam   {Double}         cr6                暂无注释
     * @apiParam   {Double}         cu                 暂无注释
     * @apiParam   {Double}         pb                 暂无注释
     * @apiParam   {Double}         cd                 暂无注释
     * @apiParam   {Double}         zn                 暂无注释
     * @apiParam   {Double}         sb                 暂无注释
     * @apiParam   {String}         speRegData         暂无注释
     * @apiParam   {Date}           ts                 暂无注释
     * @apiParam   {Date}           testComTm          暂无注释
     * @apiParam   {String}         isHistory          【必须】暂无注释
     * @apiParam   {Date}           tm                 【必须】暂无注释
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest wq/awqmd/d/latest/62285151/2017-12-31 08:00:31/1/update
     * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "stcd": "62285151",
     * "spt": "2017-12-31 08:00:31.0",
     * "wt": 9.2,
     * "ph": 7.78,
     * "cond": 233,
     * "turb": 4,
     * "dox": 9.8,
     * "codmn": 2.8,
     * "codcr": null,
     * "tn": 0.66,
     * "nh3n": 0,
     * "no2": null,
     * "no3": null,
     * "tp": 0.001,
     * "toc": null,
     * "vlph": null,
     * "chla": null,
     * "f": null,
     * "ars": null,
     * "hg": null,
     * "cr6": null,
     * "cu": null,
     * "pb": null,
     * "cd": null,
     * "zn": null,
     * "sb": null,
     * "speRegData": "0",
     * "ts": "2017-12-31 10:00:00.0",
     * "testComTm": null,
     * "isHistory": "1",
     * "tm": "2018-12-27 14:02:19.0"
     * }
     * @apiUse exceptions
     */
    @PUT
    @Path("{stcd:\\w{8}}/{spt}/{isHistory:\\w{1}}/update")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response update(@PathParam("stcd") String stcd,@PathParam("spt") String spt,@PathParam("isHistory") String isHistory, WqAwqmdDLatest record) {
        record.setStcd(stcd);
        LocalDateTime.parse(spt,LocalDateTimeUtil.DATE_TIME_FORMATTER_YMD_HMS);
        record.setIsHistory(isHistory);
        LOGGER.info("根据主键修改 ,参数 WqAwqmdDLatest:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wqAwqmdDLatestService.updateByPrimaryKey(record)))).build();
    }

    /**
     * @api {put} wq/awqmd/d/latest/{stcd:\\w{8}}/{spt}/{isHistory:\\w{1}}/update-selective [U][G]根据主键修改(只修改非null字段)
     * @apiPrivate
     * @apiDescription [G]根据主键修改T_WHHT_WQ_AWQMD_D_LATEST()数据,只修改非null字段
     * @apiName (generate)update selected data
     * @apiGroup WQ_AWQMD_D_LATEST-
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               暂无注释
     * @apiParam   {Date}           spt                暂无注释
     * @apiParam   {Double}         wt                 暂无注释
     * @apiParam   {Double}         ph                 暂无注释
     * @apiParam   {Integer}        cond               暂无注释
     * @apiParam   {Integer}        turb               暂无注释
     * @apiParam   {Double}         dox                暂无注释
     * @apiParam   {Double}         codmn              暂无注释
     * @apiParam   {Double}         codcr              暂无注释
     * @apiParam   {Double}         tn                 暂无注释
     * @apiParam   {Double}         nh3n               暂无注释
     * @apiParam   {Double}         no2                暂无注释
     * @apiParam   {Double}         no3                暂无注释
     * @apiParam   {Double}         tp                 暂无注释
     * @apiParam   {Double}         toc                暂无注释
     * @apiParam   {Double}         vlph               暂无注释
     * @apiParam   {Double}         chla               暂无注释
     * @apiParam   {Double}         f                  暂无注释
     * @apiParam   {Double}         ars                暂无注释
     * @apiParam   {Double}         hg                 暂无注释
     * @apiParam   {Double}         cr6                暂无注释
     * @apiParam   {Double}         cu                 暂无注释
     * @apiParam   {Double}         pb                 暂无注释
     * @apiParam   {Double}         cd                 暂无注释
     * @apiParam   {Double}         zn                 暂无注释
     * @apiParam   {Double}         sb                 暂无注释
     * @apiParam   {String}         speRegData         暂无注释
     * @apiParam   {Date}           ts                 暂无注释
     * @apiParam   {Date}           testComTm          暂无注释
     * @apiParam   {String}         isHistory          暂无注释
     * @apiParam   {Date}           tm                 暂无注释
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest wq/awqmd/d/latest/62285151/2017-12-31 08:00:31/1/update-selective
     * * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "stcd": "62285151",
     * "spt": "2017-12-31 08:00:31.0",
     * "wt": 9.2,
     * "ph": 7.78,
     * "cond": 233,
     * "turb": 4,
     * "dox": 9.8,
     * "codmn": 2.8,
     * "codcr": null,
     * "tn": 0.66,
     * "nh3n": 0,
     * "no2": null,
     * "no3": null,
     * "tp": 0.001,
     * "toc": null,
     * "vlph": null,
     * "chla": null,
     * "f": null,
     * "ars": null,
     * "hg": null,
     * "cr6": null,
     * "cu": null,
     * "pb": null,
     * "cd": null,
     * "zn": null,
     * "sb": null,
     * "speRegData": "0",
     * "ts": "2017-12-31 10:00:00.0",
     * "testComTm": null,
     * "isHistory": "1",
     * "tm": "2018-12-27 14:02:19.0"
     * }
     * @apiUse exceptions
     */
    @PUT
    @Path("{stcd:\\w{8}}/{spt}/{isHistory:\\w{1}}/update-selective")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response updateSelective(@PathParam("stcd") String stcd,@PathParam("spt") String spt,@PathParam("isHistory") String isHistory, WqAwqmdDLatest record) {
        record.setStcd(stcd);
        LocalDateTime.parse(spt,LocalDateTimeUtil.DATE_TIME_FORMATTER_YMD_HMS);
        record.setIsHistory(isHistory);
        LOGGER.info("根据主键修改(只修改非null字段) ,参数 WqAwqmdDLatest:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wqAwqmdDLatestService.updateByPrimaryKeySelective(record)))).build();
    }

    /**
     * @api {post} wq/awqmd/d/latest/updateBatch [U][G]根据主键批量修改(只修改非null字段)
     * @apiPrivate
     * @apiDescription [G]根据批量主键修改T_WHHT_WQ_AWQMD_D_LATEST()数据,只修改非null字段
     * @apiName (generate)updateBatch selected data
     * @apiGroup WQ_AWQMD_D_LATEST-
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               暂无注释
     * @apiParam   {Date}           spt                暂无注释
     * @apiParam   {Double}         wt                 暂无注释
     * @apiParam   {Double}         ph                 暂无注释
     * @apiParam   {Integer}        cond               暂无注释
     * @apiParam   {Integer}        turb               暂无注释
     * @apiParam   {Double}         dox                暂无注释
     * @apiParam   {Double}         codmn              暂无注释
     * @apiParam   {Double}         codcr              暂无注释
     * @apiParam   {Double}         tn                 暂无注释
     * @apiParam   {Double}         nh3n               暂无注释
     * @apiParam   {Double}         no2                暂无注释
     * @apiParam   {Double}         no3                暂无注释
     * @apiParam   {Double}         tp                 暂无注释
     * @apiParam   {Double}         toc                暂无注释
     * @apiParam   {Double}         vlph               暂无注释
     * @apiParam   {Double}         chla               暂无注释
     * @apiParam   {Double}         f                  暂无注释
     * @apiParam   {Double}         ars                暂无注释
     * @apiParam   {Double}         hg                 暂无注释
     * @apiParam   {Double}         cr6                暂无注释
     * @apiParam   {Double}         cu                 暂无注释
     * @apiParam   {Double}         pb                 暂无注释
     * @apiParam   {Double}         cd                 暂无注释
     * @apiParam   {Double}         zn                 暂无注释
     * @apiParam   {Double}         sb                 暂无注释
     * @apiParam   {String}         speRegData         暂无注释
     * @apiParam   {Date}           ts                 暂无注释
     * @apiParam   {Date}           testComTm          暂无注释
     * @apiParam   {String}         isHistory          暂无注释
     * @apiParam   {Date}           tm                 暂无注释
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest  wq/awqmd/d/latest/updateBatch
     * * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * [{
     * "stcd": "62285151",
     * "spt": "2017-12-31 08:00:31.0",
     * "wt": 9.2,
     * "ph": 7.78,
     * "cond": 233,
     * "turb": 4,
     * "dox": 9.8,
     * "codmn": 2.8,
     * "codcr": null,
     * "tn": 0.66,
     * "nh3n": 0,
     * "no2": null,
     * "no3": null,
     * "tp": 0.001,
     * "toc": null,
     * "vlph": null,
     * "chla": null,
     * "f": null,
     * "ars": null,
     * "hg": null,
     * "cr6": null,
     * "cu": null,
     * "pb": null,
     * "cd": null,
     * "zn": null,
     * "sb": null,
     * "speRegData": "0",
     * "ts": "2017-12-31 10:00:00.0",
     * "testComTm": null,
     * "isHistory": "1",
     * "tm": "2018-12-27 14:02:19.0"
     * }]
     * @apiUse exceptions
     */
    @POST
    @Path("updateBatch")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response updateBatch(List<WqAwqmdDLatest> record) {
        LOGGER.info("根据主键批量修改(只修改非null字段) ,参数 WqAwqmdDLatest:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wqAwqmdDLatestService.updateBatch(record)))).build();
    }

    /**
     * @api {delete} wq/awqmd/d/latest/{stcd:\\w{8}}/{spt}/{isHistory:\\w{1}} [D][G]根据主键删除
     * @apiPrivate
     * @apiDescription [G]根据主键删除T_WHHT_WQ_AWQMD_D_LATEST()数据
     * @apiName (generate)delete by primary key
     * @apiGroup WQ_AWQMD_D_LATEST-
     * @apiVersion 1.0.0
     * @apiSampleRequest wq/awqmd/d/latest/62285151/2017-12-31 08:00:31/1
     * @apiParam   {String}         stcd               【必须】暂无注释
     * @apiParam   {Date}           spt                【必须】暂无注释
     * @apiParam   {String}         isHistory          【必须】暂无注释
     * @apiSuccess {Integer}        status             1:删除成功;0:要删除的数据不存在(可能已被删除).
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSuccessExample 删除成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 删除失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiUse exceptions
     */
    @DELETE
    @Path("{stcd:\\w{8}}/{spt}/{isHistory:\\w{1}}")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response delete(@PathParam("stcd") String stcd,@PathParam("spt") String spt,@PathParam("isHistory") String isHistory) {
         WqAwqmdDLatestKey pk = new WqAwqmdDLatestKey();
        pk.setStcd(stcd);
        LocalDateTime.parse(spt,LocalDateTimeUtil.DATE_TIME_FORMATTER_YMD_HMS);
        pk.setIsHistory(isHistory);
        LOGGER.info("根据主键删除 ,参数 pk:{}", pk);
        Integer rows = wqAwqmdDLatestService.deleteByPrimaryKey(pk);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.delete(rows))).build();
    }

    /**
     * @api {delete} wq/awqmd/d/latest/by-filter [D][G]根据条件删除
     * @apiPrivate
     * @apiDescription [G]根据条件删除T_WHHT_WQ_AWQMD_D_LATEST()数据
     * @apiName (generate)delete by filter
     * @apiGroup WQ_AWQMD_D_LATEST-
     * @apiVersion 1.0.0
     * @apiSampleRequest wq/awqmd/d/latest/by-filter
     * @apiParam   {String}         stcd               暂无注释
     * @apiParam   {Date}           sptBgTm            (开始时间)暂无注释
     * @apiParam   {Date}           sptEdTm            (结束时间)暂无注释
     * @apiParam   {List(Double)}   wtList             (数组)暂无注释
     * @apiParam   {List(Double)}   phList             (数组)暂无注释
     * @apiParam   {Integer}        condMin            (最小)暂无注释
     * @apiParam   {Integer}        condMax            (最大)暂无注释
     * @apiParam   {List(Integer)}  turbList           (数组)暂无注释
     * @apiParam   {List(Double)}   doxList            (数组)暂无注释
     * @apiParam   {Double}         codmnMin           (最小)暂无注释
     * @apiParam   {Double}         codmnMax           (最大)暂无注释
     * @apiParam   {Double}         codcrMin           (最小)暂无注释
     * @apiParam   {Double}         codcrMax           (最大)暂无注释
     * @apiParam   {Double}         tnMin              (最小)暂无注释
     * @apiParam   {Double}         tnMax              (最大)暂无注释
     * @apiParam   {Double}         nh3nMin            (最小)暂无注释
     * @apiParam   {Double}         nh3nMax            (最大)暂无注释
     * @apiParam   {Double}         no2Min             (最小)暂无注释
     * @apiParam   {Double}         no2Max             (最大)暂无注释
     * @apiParam   {Double}         no3Min             (最小)暂无注释
     * @apiParam   {Double}         no3Max             (最大)暂无注释
     * @apiParam   {Double}         tpMin              (最小)暂无注释
     * @apiParam   {Double}         tpMax              (最大)暂无注释
     * @apiParam   {List(Double)}   tocList            (数组)暂无注释
     * @apiParam   {Double}         vlphMin            (最小)暂无注释
     * @apiParam   {Double}         vlphMax            (最大)暂无注释
     * @apiParam   {Double}         chlaMin            (最小)暂无注释
     * @apiParam   {Double}         chlaMax            (最大)暂无注释
     * @apiParam   {Double}         fMin               (最小)暂无注释
     * @apiParam   {Double}         fMax               (最大)暂无注释
     * @apiParam   {Double}         arsMin             (最小)暂无注释
     * @apiParam   {Double}         arsMax             (最大)暂无注释
     * @apiParam   {Double}         hgMin              (最小)暂无注释
     * @apiParam   {Double}         hgMax              (最大)暂无注释
     * @apiParam   {Double}         cr6Min             (最小)暂无注释
     * @apiParam   {Double}         cr6Max             (最大)暂无注释
     * @apiParam   {Double}         cuMin              (最小)暂无注释
     * @apiParam   {Double}         cuMax              (最大)暂无注释
     * @apiParam   {Double}         pbMin              (最小)暂无注释
     * @apiParam   {Double}         pbMax              (最大)暂无注释
     * @apiParam   {Double}         cdMin              (最小)暂无注释
     * @apiParam   {Double}         cdMax              (最大)暂无注释
     * @apiParam   {Double}         znMin              (最小)暂无注释
     * @apiParam   {Double}         znMax              (最大)暂无注释
     * @apiParam   {Double}         sbMin              (最小)暂无注释
     * @apiParam   {Double}         sbMax              (最大)暂无注释
     * @apiParam   {List(String)}   speRegDataList     (数组)暂无注释
     * @apiParam   {Date}           tsBgTm             (开始时间)暂无注释
     * @apiParam   {Date}           tsEdTm             (结束时间)暂无注释
     * @apiParam   {Date}           testComTmBgTm      (开始时间)暂无注释
     * @apiParam   {Date}           testComTmEdTm      (结束时间)暂无注释
     * @apiParam   {List(String)}   isHistoryList      (数组)暂无注释
     * @apiParam   {Date}           tmBgTm             (开始时间)暂无注释
     * @apiParam   {Date}           tmEdTm             (结束时间)暂无注释
     * @apiSuccess {Integer}        status             通常1或者>1:删除成功;0:没有符合条件的数据.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSuccessExample 删除成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 删除失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiUse exceptions
     */
    @DELETE
    @Path("by-filter")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response deleteByFilter(WqAwqmdDLatestQo filter) {
        LOGGER.info("根据条件删除 ,参数 WqAwqmdDLatestQo:{}", filter);
        Integer rows = wqAwqmdDLatestService.deleteByFilter(filter);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.delete(rows))).build();
    }
}
